﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BrandList.aspx.cs" Inherits="Shop.Web.BrandList" %>
<%@ Import Namespace="Edge.Common.Utils"%>
<asp:Content ID="contentMain" runat="server" ContentPlaceHolderID="mainContent" >
<asp:GridView runat="server" id="grid" 
AllowPaging="true" AllowSorting="true" PageSize="10" AutoGenerateColumns="false" OnRowDataBound="grid_DataBinding">
    <Columns> 
         <asp:TemplateField>
            <ItemTemplate>
               <%# ((int)DataBinder.Eval(Container, "DataItemIndex") + 1).ToString() %> </a>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField>
            <ItemTemplate>
                <asp:Image runat="server" id="imgLogo" AlternateText='<%# DataBinder.Eval(Container.DataItem, "Name")%>'></asp:Image>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField>
            <ItemTemplate>
                <a href="BrandDetails.aspx?action=view&id=<%# DataBinder.Eval(Container.DataItem, "Id")%>"><%# DataBinder.Eval(Container.DataItem, "Name")%></a><br />
                <%# StringUtils.TextileToHtml(DataBinder.Eval(Container.DataItem, "Description"))%>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField>
            <ItemTemplate>
                <a href="BrandDetails.aspx?action=edit&id=<%# DataBinder.Eval(Container.DataItem, "Id")%>">Редактировать</a>&nbsp;<asp:Button runat="server" id="btnDelete" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "Id")%>' Text="Удалить" OnClick="btnDelete_Click"/>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
    </asp:GridView>  
</asp:Content>